import React from "react";
import { useSelector, useDispatch } from "react-redux";
import { getMoveListAction } from "../../store/MoveSlice";
export const Move = () => {
  const count = useSelector((state) => state.count.count);
  const moveList = useSelector((state) => {
    console.log(state.Move.moveList);
    return state.Move.moveList;
  });
  const dispatch = useDispatch();
  const getMovieHandle = () => {
    dispatch(getMoveListAction());
  };
  return (
    <div>
      <h1>我是Movie组件</h1>
      <p>我收到的Count组件的值是 {count}</p>

      <button onClick={getMovieHandle}>获取电影的数据</button>
      <ul>
        {moveList.map((item) => {
          return <li key={item.tvId}>{item.albumName}</li>;
        })}
      </ul>
    </div>
  );
};
